package com.jjkj.environmental.environmental.utils.pull

import android.support.annotation.NonNull
import okhttp3.RequestBody
import retrofit2.Converter
import java.io.IOException


class PullRequestConverter<T> internal constructor(private val type: Class<T>) : Converter<T, RequestBody> {


    @Throws(IOException::class)
    override fun convert(@NonNull value: T): RequestBody {
        val xml = PullConverter.convertRequest(value!!)
        return RequestBody.create(PullConverterFactory.XML, xml)
    }
}